package com.baiwei.vpnapi.dao;

import com.baiwei.vpnapi.entity.VpnAllowedip;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @program: vpnapi
 * @description: allow ip Dao
 * @author: Mr. Stone
 * @create: 2020-03-03 17:06
 **/
@Mapper
public interface AllowIpMapper extends BaseMapper<VpnAllowedip> {
    @Select("select * from allowip where status = 1 and server_id = #{serverId} order by rand() limit 1")
    public VpnAllowedip selectRandAllowIp(Integer serverId);
}
